import java.util.Scanner;

public class gold {
	 public static void main(String[] args){
	 int N=10;
	 int b=2;
		@SuppressWarnings("resource")
		Scanner scanner=new Scanner(System.in);
		double sum;
		double max,min;
		int maxtotal=0;
		int mintotal=0;
		int []total=new int[100];
		double []value=new double[100];
		int [][]grade=new int[100][100];
		for(int j=1;j<=b;j++)
		{ 
			sum=0.0;
			max=0.0;
			System.out.println("第"+j+"轮游戏");
			for(int i=1;i<=N;i++)
			{
				System.out.print("请输入玩家"+i+"输入的数字：");
				double num=scanner.nextDouble();
			    value[i]=num;
				sum=sum+num;
			}
			double G=(sum/N)*0.618;
			min=Math.abs(value[1]-G);
			for(int l=1;l<=N;l++)
			{
				if(Math.abs(value[l]-G)>=max)
				{
					max=Math.abs(value[l]-G);
				}
			
				if(Math.abs(value[l]-G)<=min)
				{
					min=Math.abs(value[l]-G);	
				}
        			
			}
			for(int m=1;m<=N;m++)
			{
				if(Math.abs(value[m]-G)==max)
				{
					grade[j][m]=-2;
				}
				if(Math.abs(value[m]-G)==min)
				{
					grade[j][m]=N;
				}
				if(Math.abs(value[m]-G)!=max&&Math.abs(value[m]-G)!=min)
				{
					grade[j][m]=0;
				}
			}
			for(int n=1;n<=N;n++)
			{
				System.out.println("第"+n+"名游戏玩家所得分数为："+grade[j][n]);
			}
		}
		for(int s=1;s<=N;s++)
		{
			total[s]=0;
		}
		for(int p=1;p<=N;p++)
		{
			for(int q=1;q<=b;q++)
			{
				total[p]=grade[q][p]+total[p];
			}
		}
		for(int r=1;r<=N;r++)
		{
			System.out.println("第"+r+"名玩家所得总分为："+total[r]);
		}
		for(int s=1;s<=N;s++)
		{
			if(total[s]>=maxtotal)
			{
				maxtotal=total[s];
			}
			if(total[s]<=mintotal)
			{
				mintotal=total[s];
			}
		}
		for(int t=1;t<=N;t++)
		{
			if(total[t]==maxtotal)
			{
				System.out.println("玩家"+t+"胜利！");
			}
			if(total[t]==mintotal)
			{
				System.out.println("玩家"+t+"惜败！");
			}
		}
	}
}
